package io.sdph.controller;

import io.sdph.order.IOrderManager;
import io.sdph.userprofile.ISessionManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;


/**
 * Servlet odpowiedzialny za ustalenie statusu platnosci w panelu przedstawiciela handlowego (admin.jsp)
 *
 * @author MODUL FRONTU (WWW)
 */
@Controller
@RequestMapping("/admin/SetPaymentStatus")
public class AdminSetPaymentStatus {

    	private static final String SELECTED_ORDER = "orders";
        private static final String PAYMENT_STATUS = "payStatus";
        private static final String ANOTHER = "all";        
       
        private static final String PAGE_VIEW = "admin";

        /** Komponent pomocniczy do zarz�dzania sesj� u�ytkownika. */
        @Autowired
        ISessionManager sessionManager;
      
        @Autowired
        IOrderManager orderManager;
        
        //HttpServletRequest arg0, HttpServletResponse arg1
        @RequestMapping(method=RequestMethod.GET)
        public ModelAndView showPage() throws Exception {
               
                ModelAndView model = new ModelAndView(PAGE_VIEW);
                model.addObject("pageName", "paymentStatus");
                return model;
        }
       
        @RequestMapping(method=RequestMethod.POST)
        public ModelAndView adminSetPaymentStatus(
                		@RequestParam(SELECTED_ORDER) final String order, 
                        @RequestParam(PAYMENT_STATUS) final String paymentStatus                     
        				) {
               
                ModelAndView model = new ModelAndView(PAGE_VIEW);         
                model.addObject("pageName", "paymentStatus");
                // 
                //Order order = orderManager.get
                return model;
        }
       
}
